package model;

import java.sql.Connection;
import java.sql.DriverManager;

public class Connect {

	public Connect() {}
	private static Connect instance;

	public static Connection getConnection() {
		Connection con = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/eonline?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true", "root", "");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return con;
	}
	
	public static Connect getInstance() {
		if (instance != null) {
			instance = new Connect();
		}
		return instance;
	}
	
	public static void main(String[] args) {
		System.out.println(Connect.getConnection());
	}



}
